home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6713 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: dispatch.news.demon.net!demon!thesett.demon.co.uk
  2. From: Andy@thesett.demon.co.uk (Andy Goodwin)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: IDE HardDrive Serial Number??
  5. Date: Sun, 18 Feb 1996 17:41:17 GMT
  6. Message-ID: <3127645c.751054@news.demon.co.uk>
  7. References: <3102f286.115207123@news.onramp.net>
  8. NNTP-Posting-Host: thesett.demon.co.uk
  9. X-NNTP-Posting-Host: thesett.demon.co.uk
  10. X-Newsreader: Forte Agent .99c/16.141
  11.  
  12. On Mon, 22 Jan 1996 02:13:36 GMT, redbaron@onramp.net (Ronnie Moller,
  13. Jr.) wrote:
  14.  
  15. >I am trying to get the information off an IDE HardDrive, for example
  16. >the Serial number, and the manufactures model number.  If some one
  17. >could point me in the write direction, I would appreciate it.
  18. >
  19. >Ronnie
  20.  
  21.  
  22.  
  23.         MOV  AH,0D     ; Code will load at 0100h
  24.         MOV  DL,80
  25.  
  26.         INT  13        ;  reset hard disk system
  27.         MOV  AX,0000   ;  issue specify drive 0
  28.  
  29.         MOV  DX,01F6   ;  command to SDH port
  30.         OUT  DX,AL
  31.         MOV  AL,EC     ; issue identify drive
  32.         MOV  DX,01F7   ; command to
  33.         OUT  DX,AL     ; command port
  34.  
  35.         ; wait a second
  36.  
  37.         MOV  AX,0000   ; isSue specify drive 0
  38.         MOV  DX,01F6   ; command to SDH port
  39.         OUT  DX,AL
  40.         MOV  AX,00E4   ; issue read sector buffer
  41.         OUT  DX,AL     ; command
  42.  
  43.  
  44.         ; wait a second
  45.  
  46.         CLD
  47.         MOV  AX,CS     i set up ES:DI to point to
  48.         MOV  ES,AX     ; current code segment and
  49.         MOV  DI,0200   ; offset 0200h for data
  50.         MOV  CX,0100   ; loop counter 0100h
  51.         MOV  DX,01F0   ; set up data port value
  52.                        ; address 0130h
  53.  
  54.         IN AX,DX       ; read word-wide port
  55.         IN AX,DX       ; read word-wide port
  56.         STOSW          ; Store in data area at
  57.         LOOP 0130      ; loop for all lOOh words
  58.  
  59.         ; wait a second
  60.  
  61.         MOV  AX,0D00   ; Reset disk system
  62.         MOV  DX,0080
  63.         INT  13
  64.  
  65.         ; wait a second
  66.  
  67.  
  68.